<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>客户资金汇总表 管理</title>
    <style type="text/css">
    </style>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>

<body class="iframeBody">
<div class="Wrapper">
    <div class="searchArea">
        <form id="searchBar">
            <div class="fieldset1 clearFix">
                <div class="fieldBox">
                    <div class="label">客户名称</div>
                    <div class="field">
                        <input name=applyTm id="applyTm" type="text" class="ui-datepicker" readonly="readonly" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">罚息金额</div>
                    <div class="field">
                        <input name="fineAmtMin" id="fineAmtMin" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">-</div>
                    <div class="field">
                        <input name="fineAmtMax" id="fineAmtMax" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">逾期金额</div>
                    <div class="field">
                        <input name="ovdAmtMin" id="ovdAmtMin" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">-</div>
                    <div class="field">
                        <input name="ovdAmtMax" id="ovdAmtMax" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                <div class="clearFix"></div>
                <div class="btnsBox formBtns notRight">
                    <span id="searchBtn" class="sq-button-round">查询</span>
                    <span id="clearBtn" class="sq-button-round">清空</span>
                    <span id="applyReduBtn" onclick="applyReduction();" class="sq-button-round">减免申请</span>
                    <span id="exportFineBtn" onclick="exportFine();" class="sq-button-round">导出罚息明细</span>
                    <input id="resetBtn" type="reset" value="重置" class="l-button l-button-reset Hide"/>
                </div>
            </div>
        </form>
    </div>
    <div id="ligergrid1" class="sq-grid"></div>
</div>

<script type="text/javascript">
    var grid = null, menu = null;
    $(function () {
        grid = $("#ligergrid1").ligerGrid({
            url: '<%=path%>/capital/capFundSummary/initList.do',
            method: 'get',
            columns: [
                /*{display: '客户ID', name: 'cstId', minWidth: 100, align: 'left', enabledSort: false},*/
                {display: '客户名称', name: 'cstNm', minWidth: 100, align: 'left', enabledSort: false,},
                {display: '应收金额', name: 'arAmt', minWidth: 100, align: 'right', enabledSort: false,
                    render:function(rowdata,index,value){
                        if(value){
                            return FormatMoney(rowdata.arAmt/100);
                        }
                    }
                },
                {display: '逾期金额', name: 'ovdAmt', minWidth: 100, align: 'right', enabledSort: false,
                    render:function(rowdata,index,value){
                        if(value){
                            return FormatMoney(rowdata.ovdAmt/100);
                        }
                    }
                },
                {display: '罚息金额', name: 'fineAmt', minWidth: 100, align: 'right', enabledSort: false,
                    render:function(rowdata,index,value){
                        if(value){
                            return FormatMoney(rowdata.fineAmt/100);
                        }
                    }
                },
                {display: '当天租金', name: 'rentAmt', minWidth: 100, align: 'right', enabledSort: false,
                    render:function(rowdata,index,value){
                        if(value){
                            return FormatMoney(rowdata.rentAmt/100);
                        }
                    }
                },
            ],
            pageSize: 10,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: '100%',
            height: '100%',
            heightDiff: -2,
            checkbox: true,
            rownumbers: true,
            allowUnSelectRow: true,
            alternatingRow: false
        });
        grid.setHeight(100);

        $("#searchBar").ligerForm();

        $("#pageloading").hide();

        /* 查询 */
        $("#searchBtn").click(function (event) {
            var form = liger.get("searchBar");
            var data = form.getData();
            for (name in data) {
                grid.setParm(name, data[name]);
            }
            grid.reload();
        });

        /* 清空 */
        $("#clearBtn").click(function (event) {
            $("#resetBtn").click();  //重置 input-text
            var form = liger.get("searchBar");
            form.setData({  //重置select等特殊表单
                "*Cd": " "
            });
        });

        var callback = function () {
            grid.reload();
        };

        /* 减免申请 */
        $("#applyReduBtn").click(function (event) {
            /*$.ligerDialog.open({
                cls: 'noBorder_Dialog',
                width: 550,
                height: 500,
                title: '新增客户资金汇总表',
                url: '<%=path%>/capital/capFundSummary/toAddPage.do'
            });*/
            //Add_navTab("CapFundSummary_1", "新增客户资金汇总表", '<%=path%>/capital/capFundSummary/toAddPage.do', callback);
        });

        /* 修改 */
        $("#exportFineBtn").click(function (event) {
            /*var selectedRows = grid.getSelectedRows();
            if (selectedRows.length != 1) {
                $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_SELECT_ONLY_A_ROW, SQ_type: "warning"});
                return;
            }
            var _id = selectedRows[0].id;
            $.ligerDialog.open({
                cls: 'noBorder_Dialog',
                width: 550,
                height: 500,
                title: '修改客户资金汇总表',
                url: '<%=path%>/capital/capFundSummary/toModifyPage.do?id=' + _id
            });*/
            //Add_navTab('CapFundSummary_2'+_id, "修改客户资金汇总表", '<%=path%>/capital/capFundSummary/toModifyPage.do?id='+_id, callback);
        });

    });

</script>

</body>
</html>
